package cn.com.pajx.pajx_smart_platform.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import cn.com.pajx.pajx_smart_platform.ui.activity.SplashActivity;

/**
 * Created by ruancw on 2023/5/8.
 */

public class AutoStartBroadcastReceiver extends BroadcastReceiver {
    static final String action_boot = "android.intent.action.BOOT_COMPLETED";

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals(Intent.ACTION_BOOT_COMPLETED)) {
            Intent autoIntent = new Intent(context, SplashActivity.class);
            autoIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(autoIntent);
        }
    }
}
